package com.smfx.yxt;

import java.util.List;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.fastjson.JSON;
import com.smfx.yxt.common.RspResult;
import com.smfx.yxt.common.enums.Status;
import com.smfx.yxt.model.TeacherOrganizeGroup;
import com.smfx.yxt.service.IOrganizeDepartService;
import com.smfx.yxt.service.ITeacherService;
import com.smfx.yxt.service.IWorkApprovalService;

public class WorkApprovalService extends BaseTest{
	
	@Autowired
	private  IWorkApprovalService workApprovalService;
	@Autowired
	private ITeacherService teacherService;
	@Autowired
	private IOrganizeDepartService organizeDepartService;

//	@Test
//	public void detail(){
//		try {
//			WorkApprovalView view = workApprovalService.selectViewDetail(1);
//			System.out.println(JSON.toJSONString(view));
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//	}
	
	
	@Test
	public void group() {
		try {
			String groupIds = "10,20,30";
			List<TeacherOrganizeGroup> list = null;//organizeDepartService.fillTeacherOrganizeGroupByGroupIds(groupIds);
			RspResult result = new RspResult(Status.SUCCESS, list);
			System.out.println(JSON.toJSONString(result));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
//	@Test
//	public void pageQuery() {
//		try {
//			WorkApprovalQueryVO vo = new WorkApprovalQueryVO();
//			vo.setApprovalStatus(WorkApprovalStatus.AUDIT_PENING.getCode());
//			vo.setApplyerId(195);
//			Page<WorkApprovalView> page = new Page<WorkApprovalView>();
//			Grid grid = new Grid();
//			List<OrderBy> sorts = new ArrayList<>();
//			sorts.add(new OrderBy("APPROVAL_TIME"));
//			sorts.add(new OrderBy("APPLY_TIME"));
//			page.setSorts(sorts);
//			page.setParams(vo);
//			page.setPageNo(vo.getPage());
//			page.setPageSize(vo.getRows());
//			List<WorkApprovalView> list = workApprovalService.selectViewListByPage(page);
//			grid.setRows(list);
//			grid.setTotal(page.getTotalRecord());
//			System.out.println(JSONObject.toJSONString(grid));
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//	}
	
	/*@Test
	public void addWorkApproval() {
		try {
			TeacherInfo teacherInfo = teacherService.selectById(195);
			TeacherInfoView view = BeanUtils.copyAs(teacherInfo, TeacherInfoView.class);
			WorkApprovalReqVO reqVO = new WorkApprovalReqVO();
			reqVO.setApprovalType(WorkApprovalType.COPY_PAPER.getCode());
			reqVO.setPrintingPaperUse("用于奖状制作用于奖状制作用于奖状制作用于奖状制作用于奖状制作用于奖状制作用于奖状制作");
			reqVO.setUsePosition("学校里面");
			reqVO.setApplyItems("数量（包）|1,纸张类型|A4白纸,单面或双面:单面");
			reqVO.setSchoolId(view.getSchoolId());
			reqVO.setSchoolName(view.getSchoolName());
			reqVO.setDepart(view.getDepartText());
			reqVO.setApplyer(view.getName());
			reqVO.setApplyerId(view.getId());
			workApprovalService.addWorkApproval(reqVO);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}*/
	
	
}
